import {useNavigate} from "react-router-dom";

function HomeView() {

    const navigate = useNavigate();

    const handleClick = () => {
        // 👇️ navigate programmatically
        navigate('/about');
    };
    return (
        <div>
            <h1>首页</h1>
            <button onClick={handleClick}>Navigate to About</button>
        </div>
    );
}

export default HomeView;
